package com.code.factory;

import com.code.fegin.ProviderClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author : [mxf]
 * @version : [v1.0]
 * @className : UserClientFallbackFactory
 * @description : [描述说明该类的功能]
 * @createTime : [2022/9/24 19:48]
 * @updateUser : [mxf]
 * @updateTime : [2022/9/24 19:48]
 * @updateRemark : [描述说明本次修改内容]
 */
@Slf4j
public class ProviderClientFallbackFactory implements FallbackFactory<ProviderClient> {
    @Override
    public ProviderClient create(Throwable throwable) {
        return new ProviderClient() {
            @Override
            public String hi(int i) {
                throwable.printStackTrace();
                log.error("接口查询错误");
                return "错误500";
            }
        };
    }
}
